CREATE DATABASE  IF NOT EXISTS `cms` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `cms`;
-- MySQL dump 10.13  Distrib 5.5.16, for Win32 (x86)
--
-- Host: localhost    Database: cms
-- ------------------------------------------------------
-- Server version	5.1.48-community

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `Cms_Role_Power_Relation`
--

DROP TABLE IF EXISTS `Cms_Role_Power_Relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_Role_Power_Relation` (
  `Id` int(11) NOT NULL,
  `PowerId` int(11) NOT NULL,
  `RoleId` int(11) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_Role_Power_Relation`
--

LOCK TABLES `Cms_Role_Power_Relation` WRITE;
/*!40000 ALTER TABLE `Cms_Role_Power_Relation` DISABLE KEYS */;
/*!40000 ALTER TABLE `Cms_Role_Power_Relation` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Cms_ArticleState`
--

DROP TABLE IF EXISTS `Cms_ArticleState`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_ArticleState` (
  `ArticleStateId` int(11) NOT NULL AUTO_INCREMENT,
  `ArticleStateName` varchar(1000) NOT NULL,
  PRIMARY KEY (`ArticleStateId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_ArticleState`
--

LOCK TABLES `Cms_ArticleState` WRITE;
/*!40000 ALTER TABLE `Cms_ArticleState` DISABLE KEYS */;
/*!40000 ALTER TABLE `Cms_ArticleState` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Cms_ArticleComment`
--

DROP TABLE IF EXISTS `Cms_ArticleComment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_ArticleComment` (
  `ArticleId` int(11) NOT NULL,
  `Comment` varchar(1000) NOT NULL,
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_ArticleComment`
--

LOCK TABLES `Cms_ArticleComment` WRITE;
/*!40000 ALTER TABLE `Cms_ArticleComment` DISABLE KEYS */;
/*!40000 ALTER TABLE `Cms_ArticleComment` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Cms_ArticleTitles`
--

DROP TABLE IF EXISTS `Cms_ArticleTitles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_ArticleTitles` (
  `ArticleTitleId` int(11) NOT NULL AUTO_INCREMENT,
  `SecondTitle` varchar(1000) DEFAULT NULL,
  `ThirdTitle` varchar(1000) DEFAULT NULL,
  `Title` varchar(1000) NOT NULL,
  PRIMARY KEY (`ArticleTitleId`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_ArticleTitles`
--

LOCK TABLES `Cms_ArticleTitles` WRITE;
/*!40000 ALTER TABLE `Cms_ArticleTitles` DISABLE KEYS */;
INSERT INTO `Cms_ArticleTitles` VALUES (1,'春暖花开惹人醉','春暖花开惹人醉','春暖花开惹人醉 3月最佳出游地推荐'),(2,'春暖花开惹人醉','春暖花开惹人醉','春暖花开惹人醉 3月最佳出游地推荐');
/*!40000 ALTER TABLE `Cms_ArticleTitles` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Cms_User`
--

DROP TABLE IF EXISTS `Cms_User`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_User` (
  `DeptId` int(11) NOT NULL,
  `UserId` int(11) NOT NULL AUTO_INCREMENT,
  `UserName` varchar(1000) NOT NULL,
  `UserPassword` varchar(1000) NOT NULL,
  `UserRoleId` int(11) NOT NULL,
  PRIMARY KEY (`UserId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_User`
--

LOCK TABLES `Cms_User` WRITE;
/*!40000 ALTER TABLE `Cms_User` DISABLE KEYS */;
/*!40000 ALTER TABLE `Cms_User` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Cms_Role`
--

DROP TABLE IF EXISTS `Cms_Role`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_Role` (
  `RoleId` int(11) NOT NULL,
  `RoleName` varchar(1000) NOT NULL,
  PRIMARY KEY (`RoleId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_Role`
--

LOCK TABLES `Cms_Role` WRITE;
/*!40000 ALTER TABLE `Cms_Role` DISABLE KEYS */;
/*!40000 ALTER TABLE `Cms_Role` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Cms_ArticleContent`
--

DROP TABLE IF EXISTS `Cms_ArticleContent`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_ArticleContent` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `ArticleId` int(11) NOT NULL,
  `PageIndex` int(11) NOT NULL,
  `ArticleContent` varchar(1000) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_ArticleContent`
--

LOCK TABLES `Cms_ArticleContent` WRITE;
/*!40000 ALTER TABLE `Cms_ArticleContent` DISABLE KEYS */;
INSERT INTO `Cms_ArticleContent` VALUES (1,1,1,'<p>\r\n	123123123</p>\r\n'),(2,1,2,'<p>\r\n	3123123123</p>\r\n'),(3,1,3,'<p>\r\n	13123123123123</p>\r\n'),(4,1,4,'<p>\r\n	123123123123</p>\r\n'),(5,1,5,'<p>\r\n	23123123123123</p>\r\n');
/*!40000 ALTER TABLE `Cms_ArticleContent` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Com_Department`
--

DROP TABLE IF EXISTS `Com_Department`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Com_Department` (
  `DeptId` int(11) NOT NULL AUTO_INCREMENT,
  `DeptName` varchar(1000) NOT NULL,
  `SuperiorId` int(11) NOT NULL,
  PRIMARY KEY (`DeptId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Com_Department`
--

LOCK TABLES `Com_Department` WRITE;
/*!40000 ALTER TABLE `Com_Department` DISABLE KEYS */;
/*!40000 ALTER TABLE `Com_Department` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Cms_ArticleType`
--

DROP TABLE IF EXISTS `Cms_ArticleType`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_ArticleType` (
  `ArticleTypeId` int(11) NOT NULL AUTO_INCREMENT,
  `ArticleTypeName` varchar(1000) NOT NULL,
  PRIMARY KEY (`ArticleTypeId`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_ArticleType`
--

LOCK TABLES `Cms_ArticleType` WRITE;
/*!40000 ALTER TABLE `Cms_ArticleType` DISABLE KEYS */;
INSERT INTO `Cms_ArticleType` VALUES (1,'新闻'),(2,'游戏'),(3,'攻略');
/*!40000 ALTER TABLE `Cms_ArticleType` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Cms_Tree`
--

DROP TABLE IF EXISTS `Cms_Tree`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_Tree` (
  `Link` varchar(1000) NOT NULL,
  `NodeId` int(11) NOT NULL AUTO_INCREMENT,
  `NodeName` varchar(1000) NOT NULL,
  `ParentNodeId` bigint(20) NOT NULL,
  PRIMARY KEY (`NodeId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_Tree`
--

LOCK TABLES `Cms_Tree` WRITE;
/*!40000 ALTER TABLE `Cms_Tree` DISABLE KEYS */;
/*!40000 ALTER TABLE `Cms_Tree` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Cms_ArticleSource`
--

DROP TABLE IF EXISTS `Cms_ArticleSource`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_ArticleSource` (
  `SourceId` int(11) NOT NULL AUTO_INCREMENT,
  `SourceName` varchar(1000) NOT NULL,
  PRIMARY KEY (`SourceId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_ArticleSource`
--

LOCK TABLES `Cms_ArticleSource` WRITE;
/*!40000 ALTER TABLE `Cms_ArticleSource` DISABLE KEYS */;
INSERT INTO `Cms_ArticleSource` VALUES (1,'http://www.lotour.com/news/20120223/651587.shtml');
/*!40000 ALTER TABLE `Cms_ArticleSource` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Cms_ArticleAuthor`
--

DROP TABLE IF EXISTS `Cms_ArticleAuthor`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_ArticleAuthor` (
  `AuthorId` int(11) NOT NULL AUTO_INCREMENT,
  `AuthorName` varchar(1000) NOT NULL,
  PRIMARY KEY (`AuthorId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_ArticleAuthor`
--

LOCK TABLES `Cms_ArticleAuthor` WRITE;
/*!40000 ALTER TABLE `Cms_ArticleAuthor` DISABLE KEYS */;
INSERT INTO `Cms_ArticleAuthor` VALUES (1,'薛亮');
/*!40000 ALTER TABLE `Cms_ArticleAuthor` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Temporary table structure for view `V_ArticleDetail`
--

DROP TABLE IF EXISTS `V_ArticleDetail`;
/*!50001 DROP VIEW IF EXISTS `V_ArticleDetail`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `V_ArticleDetail` (
  `ArticleId` int(11),
  `Title` varchar(1000),
  `SecondTitle` varchar(1000),
  `ThirdTitle` varchar(1000),
  `ArticleDescription` varchar(1000),
  `ArticleStateId` int(11),
  `ArticleStateName` varchar(1000),
  `ArticleTitleId` int(11),
  `ArticleTypeId` int(11),
  `ArticleTypeName` varchar(1000),
  `AuthorId` int(11),
  `AuthorName` varchar(1000),
  `CreateDate` datetime,
  `CreateUserId` int(11),
  `UserName` varchar(1000),
  `FocusImage` varchar(1000),
  `Seq` int(11),
  `SourceId` int(11),
  `SourceName` varchar(1000)
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `Cms_Article`
--

DROP TABLE IF EXISTS `Cms_Article`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cms_Article` (
  `ArticleId` int(11) NOT NULL AUTO_INCREMENT,
  `ArticleTitleId` int(11) NOT NULL,
  `ArticleTypeId` int(11) NOT NULL,
  `SourceId` int(11) NOT NULL,
  `ArticleDescription` varchar(1000) DEFAULT NULL,
  `ArticleStateId` int(11) NOT NULL,
  `AuthorId` int(11) NOT NULL,
  `CreateDate` datetime NOT NULL,
  `CreateUserId` int(11) NOT NULL,
  `FocusImage` varchar(1000) NOT NULL,
  `Seq` int(11) NOT NULL,
  PRIMARY KEY (`ArticleId`),
  KEY `ArticleTitleId` (`ArticleTitleId`),
  CONSTRAINT `` FOREIGN KEY (`ArticleTitleId`) REFERENCES `cms_articletitles` (`ArticleTitleId`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Cms_Article`
--

LOCK TABLES `Cms_Article` WRITE;
/*!40000 ALTER TABLE `Cms_Article` DISABLE KEYS */;
INSERT INTO `Cms_Article` VALUES (1,2,1,1,'春暖花开惹人醉 \r\n  ',1,1,'2012-03-01 10:48:48',1,'http://img.think.com/350x200/2012/3/1/10/45/20123110453866.jpg',0);
/*!40000 ALTER TABLE `Cms_Article` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Final view structure for view `V_ArticleDetail`
--

/*!50001 DROP TABLE IF EXISTS `V_ArticleDetail`*/;
/*!50001 DROP VIEW IF EXISTS `V_ArticleDetail`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `V_ArticleDetail` AS select `Article`.`ArticleId` AS `ArticleId`,`Titles`.`Title` AS `Title`,`Titles`.`SecondTitle` AS `SecondTitle`,`Titles`.`ThirdTitle` AS `ThirdTitle`,`Article`.`ArticleDescription` AS `ArticleDescription`,`Article`.`ArticleStateId` AS `ArticleStateId`,`State`.`ArticleStateName` AS `ArticleStateName`,`Article`.`ArticleTitleId` AS `ArticleTitleId`,`Article`.`ArticleTypeId` AS `ArticleTypeId`,`Type`.`ArticleTypeName` AS `ArticleTypeName`,`Article`.`AuthorId` AS `AuthorId`,`Author`.`AuthorName` AS `AuthorName`,`Article`.`CreateDate` AS `CreateDate`,`Article`.`CreateUserId` AS `CreateUserId`,`User`.`UserName` AS `UserName`,`Article`.`FocusImage` AS `FocusImage`,`Article`.`Seq` AS `Seq`,`Source`.`SourceId` AS `SourceId`,`Source`.`SourceName` AS `SourceName` from ((((((`Cms_Article` `Article` left join `Cms_ArticleAuthor` `Author` on((`Article`.`AuthorId` = `Author`.`AuthorId`))) left join `Cms_ArticleSource` `Source` on((`Article`.`SourceId` = `Source`.`SourceId`))) left join `Cms_ArticleState` `State` on((`Article`.`ArticleStateId` = `State`.`ArticleStateId`))) left join `Cms_ArticleTitles` `Titles` on((`Article`.`ArticleTitleId` = `Titles`.`ArticleTitleId`))) left join `Cms_ArticleType` `Type` on((`Article`.`ArticleTypeId` = `Type`.`ArticleTypeId`))) left join `Cms_User` `User` on((`Article`.`CreateUserId` = `User`.`UserId`))) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2012-03-01 15:01:03
